﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UserLoginDemo.DAl;
using UserLoginDemo.Model;

namespace UserLoginDemo.BLL
{
    public class UserStudentService
    {
        UserStudentServiceDAL DAL = new UserStudentServiceDAL();
        public bool ValidateUserInfo(string userName, string password, out string msg, out UserStuentLogin userStudent)
        {
            userStudent = DAL.GetUserStuentLogin(userName);
            if (userStudent!=null)
            {
                if (userStudent.Password==password)
                {
                    msg = "登陆成功";
                    return true;
                }
                else
                {
                    msg = "用户名或密码错误!!";
                    return false;
                }
            }
            else
            {
                msg = "没有此用户!!";
                return false;
            }
        }
    }
}
